/* Paper IADB: Who writes the social ¨contract? Protest Voting, Electoral Rules, and the Election of  Chile´s 2021 Constitutional Assembly */

clear all
set more off
cd "C:\Users\ignac\Dropbox\BID-CC\Papers\Disconnect_Chile"

log using "Disconnect_Chile.smcl", replace
use "Disconnect_Chile.dta", clear
 
* Set Panel Data 
xtset comuna_cod16 eleccion_cod

* Table 1.  Vote shares of left-leaning candidates compared to right-leaning candidates  

eststo clear
eststo: xtreg izqderechaind_por i.pp17 i.cc21, fe cluster(comuna_cod16) cformat(%20.10f)
ereturn list
eststo: xtreg izqderechaind_por i.pp17 i.cc21 ypc participacion gini menores40_p mujeres_p, fe cluster(comuna_cod16) cformat(%20.10f)
ereturn list
esttab using "T1_diff_voteshare.csv", replace l nobaselevels se ar2 starlevels(* 0.1 ** 0.05 *** 0.01) title("Table 1.  Difference in vote shares relative to 2021 Parliamentary Election: Left-leaning candidates compared to right-leaning candidates") /// 
mtitles("Vote Share Difference" "Vote Share Difference") postfoot("*** p<0.01 ** p<0.05 * p<0.1") nogap
log close


